package com.andyliu.advice;

import com.andyliu.vo.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * ClassName: ExceptionAdvice
 * Description: TODO
 * date: 2021/1/30 8:41 下午
 *
 * @author andyliu
 * @since JDK 1.8
 */
@ControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public Result<Object> systemException(Exception ex){
        ex.printStackTrace();
        System.out.println("**************系统出错了******************");
        return Result.error("系统出错了");
    }

}
